CREATE TABLE [dbo].[Book]
(
[Id] [int] NOT NULL,
[Name] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PublishingHouseId] [int] NOT NULL,
[PublishDate] [date] NOT NULL,
[SizeX] [int] NOT NULL,
[SizeY] [int] NOT NULL,
[Weight] [int] NOT NULL,
[Code] [nchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Intro] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BookCategoryId] [int] NULL,
[Status] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Book] ADD CONSTRAINT [PK_Book] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Book] ADD CONSTRAINT [FK_Book_BookCategory] FOREIGN KEY ([BookCategoryId]) REFERENCES [dbo].[BookCategory] ([Id])
GO
ALTER TABLE [dbo].[Book] ADD CONSTRAINT [FK_Book_PublishingHouse] FOREIGN KEY ([PublishingHouseId]) REFERENCES [dbo].[PublishingHouse] ([Id])
GO
